# users/utils.py
import hashlib


def hash_password(password: str) -> str:
    """将明文密码用 MD5 加密"""
    md5 = hashlib.md5()
    md5.update(password.encode('utf-8'))
    return md5.hexdigest()
